import Koa from "koa";
import KoaBody from "koa-body";
import userRouter from "../router/user.route.js";
import cors from "@koa/cors";

const app = new Koa();
const corsOptions = {
  origin: "http://122.152.201.203", //允许所有域名访问
  credentials: true, //允许携带cookie
};

app.use(KoaBody.koaBody());
app.use(userRouter.routes());
app.use(cors(corsOptions));

export default app;
